<h2>修改密码</h2>
<?php global $setting;?>
<script type="text/javascript">
$(document).ready(function() {
	$('.ui.form').form({
	    fields: {
	    	oldpwd: {
				identifier: 'oldpwd',
				rules: [{
					type: 'minLength[6]',
					prompt: '旧密码必须大于六位'
				},
				{
					type: 'empty',
					prompt: '旧密码不能为空'
				}]
			},
			confirmpwd: {
				identifier: 'confirmpwd',
				rules: [{
					type: 'match[newpwd]',
					prompt: '两次输入的密码必须一致'
				},
				{
					type: 'empty',
					prompt: '确认密码不能为空'
				}]
			},
			newpwd: {
				identifier: 'newpwd',
				rules: [{
					type: 'minLength[6]',
					prompt: '新密码必须大于六位'
				},
				{
					type: 'empty',
					prompt: '密码不能为空'
				}]
			}
	    }
	});
	reloadListener();
    bindAjaxForm($("#s_s_pwchange_editform"),s_s_pwchange_onSuccess,s_s_pwchange_onError,"s_s_pwchenge_dia");
    $(".dropdown").dropdown();
});
function s_s_pwchange_onError(data){
	console.log(data);
	showMessage("s_s_pwchange_message",-101,data);
}
function s_s_pwchange_onSuccess(data){
    try {
        showMessage("s_s_pwchange_message",data["code"], data["message"]);
    } catch(ex) {
    	showMessage("s_s_pwchange_message",-31, data);
    }
}


</script>
<h5>修改密码</h5>
<p>您需要在这里输入先前的密码来完成修改</p>
<div class="ui success message hidden" id="s_s_pwchange_message"></div>
<form class="ui form ajaxform" id="s_s_pwchange_editform" url="index.php?mod=home&childmod=setting&ajax=ture&op=pwchange">
	<div class="field">
		<label>旧密码：</label> <input type="password" name="oldpwd" placeholder="旧密码">
	</div>
	<div class="field">
		<label>新密码：</label> <input type="password" name="newpwd" placeholder="新密码">
	</div>
	<div class="field">
		<label>确认密码：</label> <input type="password" name="confirmpwd" placeholder="确认密码">
	</div>
	<div class="ui error message"></div>
	<button class="ui button" type="submit">确定</button>
</form>